package org.itboys.mobile.dto.product;


import com.fasterxml.jackson.annotation.JsonIgnore;
import org.itboys.admin.dto.lasted.SundayUploadDto;
import org.itboys.mobile.common.SundayCommonConstants;
import org.itboys.mobile.dto.SundayCommentDto;
import org.itboys.mobile.dto.common.MobileBaseDto;
import org.itboys.mobile.dto.product.standard.SundayProductStandardDto;
import org.itboys.mobile.dto.product.standard.SundayStandardDto;
import org.itboys.mobile.dto.promotion.SundayTeamGroupDto;
import org.itboys.mobile.entity.mysql.promotion.SundayTeamGroup;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * 作者：jiangxiong
 * 日期：2017年5月8日
 * 联系方式 ：empty90911@126.com
 * 描述：圣代_商品_DTO(详情页)。
 */
public class SundayProductDto extends MobileBaseDto {
    //基本属性
    private String name;//商品名称
    private String title;//商品标题
    private String standard;//规格
    private Long categoryId;//分类ID
    private String categoryName;//分类名称，不储存
    private Long brandId;//品牌ID
    private String brandName;//品牌名称
    private BigDecimal marketPrice;//市场价。仅作参考
    private BigDecimal price;//零售价（或积分价格）。
    private Integer saleNumber;//销量
    private Integer store;//库存
    private Integer status;//状态。0已下架,1已上架,2未开始/已结束,3已售罄
    private Integer type;//1普通，2新品，3特卖，4全球购，5金领，6爱购币，7积分，8秒杀，9拼团，10试用
    private String place;//产地
    private String brandImage;//品牌图片
    //其他属性
    private String barCode ;//条码
    private BigDecimal star;//评分
    private Long shopId;//商家ID;
    private String shopName;//商家名称
    private String shopImage;//店铺详情
    private String shopDesc;//店铺简介
    private Integer cartProductNum;//购物车商品总数量

    //全球购
    private BigDecimal tax;//关税
    private String taxMsg;//关税、发货地等说明
    //秒杀(疯抢)
    @JsonIgnore
    private String secKillTimeGroupValue;//秒杀商品时间组value。从字典中获取
    private Integer secKillStore;//秒杀商品数量
    private String secKillTime;//秒杀商品截至时间
    //拼团
    private Integer teamMax;//拼团最大人数
    private BigDecimal teamPrice;//拼团价格
   private List<SundayTeamGroupDto> teamGroups;
   private Integer teamGroupNumber;
  //  private Integer teamHour;//拼团有效时间（小时）
    //爱购币
    private BigDecimal aigouPrice;//需要兑换的爱购币,2018年1月16日，废弃
    //其他属性
    private String image;//商品主图
    private Integer isCollection;//是否收藏
    private String desc;//商品详情html代码
    private String descUrl;//商品详情网页地址
    private List<SundayUploadDto> rollImages;//商品轮播图
    private List<SundayProductDto> products;//推荐商品。4个
    private List<SundayCommentDto> comments;//评论。5条
    private Long commentCount;//评论总数
    //分享属性
    private String shareUrl;//分享地址
    private String shareImage;//分享图片
    private String shareTitle;//分享名称
    private String shareDesc;//分享描述
    //2018年2月8日
    private Integer isDiscount;//是否允许折扣;
    public SundayProductDto() {
    }

    public SundayProductDto(long id, String createTime, String createDate, String name,
                            String title, String standard, Long categoryId, String categoryName, Long brandId,
                            String brandName, BigDecimal marketPrice, BigDecimal price, Integer saleNumber,
                            Integer store, Integer status, Integer type, String barCode, BigDecimal star,String place,String desc,Integer isDiscount) {
        super(id, createTime, createDate);
        this.name = name;
        this.title = title;
        this.standard = standard;
        this.categoryId = categoryId;
        this.categoryName = categoryName;
        this.brandId = brandId;
        this.brandName = brandName;
        this.marketPrice = marketPrice;
        this.price = price;
        this.saleNumber = saleNumber;
        this.store = store;
        this.status = status;
        this.type = type;
        this.barCode = barCode;
        this.star = star;
        this.place=place;
        this.desc=desc;
        this.isDiscount=isDiscount;

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getStandard() {
        return standard;
    }

    public void setStandard(String standard) {
        this.standard = standard;
    }

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Long getBrandId() {
        return brandId;
    }

    public void setBrandId(Long brandId) {
        this.brandId = brandId;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public BigDecimal getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(BigDecimal marketPrice) {
        this.marketPrice = marketPrice;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getSaleNumber() {
        return saleNumber;
    }

    public void setSaleNumber(Integer saleNumber) {
        this.saleNumber = saleNumber;
    }

    public Integer getStore() {
        return store;
    }

    public void setStore(Integer store) {
        this.store = store;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public BigDecimal getStar() {
        return star;
    }

    public void setStar(BigDecimal star) {
        this.star = star;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }

    public String getShopImage() {
        return shopImage;
    }

    public void setShopImage(String shopImage) {
        this.shopImage = shopImage;
    }

    public String getShopDesc() {
        return shopDesc;
    }

    public void setShopDesc(String shopDesc) {
        this.shopDesc = shopDesc;
    }

    public BigDecimal getTax() {
        return tax;
    }

    public void setTax(BigDecimal tax) {
        this.tax = tax;
    }

    public String getTaxMsg() {
        return taxMsg;
    }

    public void setTaxMsg(String taxMsg) {
        this.taxMsg = taxMsg;
    }

    public String getSecKillTimeGroupValue() {
        return secKillTimeGroupValue;
    }

    public void setSecKillTimeGroupValue(String secKillTimeGroupValue) {
        this.secKillTimeGroupValue = secKillTimeGroupValue;
    }

    public Integer getSecKillStore() {
        return secKillStore;
    }

    public void setSecKillStore(Integer secKillStore) {
        this.secKillStore = secKillStore;
    }

    public String getSecKillTime() {
        return secKillTime;
    }

    public void setSecKillTime(String secKillTime) {
        this.secKillTime = secKillTime;
    }

    public BigDecimal getTeamPrice() {
        return teamPrice;
    }

    public void setTeamPrice(BigDecimal teamPrice) {
        this.teamPrice = teamPrice;
    }

//    public List<SundayTeamGroupDto> getTeamGroups() {
//        return teamGroups;
//    }
//
//    public void setTeamGroups(List<SundayTeamGroupDto> teamGroups) {
//        this.teamGroups = teamGroups;
//    }

    public BigDecimal getAigouPrice() {
        return aigouPrice;
    }

    public void setAigouPrice(BigDecimal aigouPrice) {
        this.aigouPrice = aigouPrice;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Integer getIsCollection() {
        return isCollection;
    }

    public void setIsCollection(Integer isCollection) {
        this.isCollection = isCollection;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getDescUrl() {
        return descUrl;
    }

    public void setDescUrl(String descUrl) {
        this.descUrl = descUrl;
    }

    public List<SundayUploadDto> getRollImages() {
        return rollImages;
    }

    public void setRollImages(List<SundayUploadDto> rollImages) {
        this.rollImages = rollImages;
    }

    public List<SundayProductDto> getProducts() {
        return products;
    }

    public void setProducts(List<SundayProductDto> products) {
        this.products = products;
    }

    public List<SundayCommentDto> getComments() {
        return comments;
    }

    public void setComments(List<SundayCommentDto> comments) {
        this.comments = comments;
    }

    public String getShareUrl() {
        return shareUrl;
    }

    public void setShareUrl(String shareUrl) {
        this.shareUrl = shareUrl;
    }

    public String getShareImage() {
        return shareImage;
    }

    public void setShareImage(String shareImage) {
        this.shareImage = shareImage;
    }

    public String getShareTitle() {
        return shareTitle;
    }

    public void setShareTitle(String shareTitle) {
        this.shareTitle = shareTitle;
    }

    public String getShareDesc() {
        return shareDesc;
    }

    public void setShareDesc(String shareDesc) {
        this.shareDesc = shareDesc;
    }

    public Integer getTeamMax() {
        return teamMax;
    }

    public void setTeamMax(Integer teamMax) {
        this.teamMax = teamMax;
    }

    public List<SundayTeamGroupDto> getTeamGroups() {
        return teamGroups;
    }

    public void setTeamGroups(List<SundayTeamGroupDto> teamGroups) {
        this.teamGroups = teamGroups;
    }

    public Integer getTeamGroupNumber() {
        return teamGroupNumber;
    }

    public void setTeamGroupNumber(Integer teamGroupNumber) {
        this.teamGroupNumber = teamGroupNumber;
    }

    public Integer getCartProductNum() {
        return cartProductNum;
    }

    public void setCartProductNum(Integer cartProductNum) {
        this.cartProductNum = cartProductNum;
    }

    public Long getCommentCount() {
        return commentCount;
    }

    public void setCommentCount(Long commentCount) {
        this.commentCount = commentCount;
    }

    public String getBrandImage() {
        return brandImage;
    }

    public void setBrandImage(String brandImage) {
        this.brandImage = brandImage;
    }

    public Integer getIsDiscount() {
        return isDiscount;
    }

    public void setIsDiscount(Integer isDiscount) {
        this.isDiscount = isDiscount;
    }

    public String getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;

        switch (type) {
            case 1:
                typeStr="普通";
                break;
            case 2:
                typeStr="新品";
                break;
            case 3:
                typeStr="特卖";
                break;
            case 4:
                typeStr="全球购";
                break;
            case 5:
                typeStr="分销";
                break;
            case 6:
                typeStr="爱购币";
                break;
            case 7:
                typeStr="积分";
                break;
            case 8:
                typeStr="秒杀";
                break;
            case 9:
                typeStr="拼团";
                break;
            case 10:
                typeStr="达人试用";
                break;
            default:
                break;
        }
        return typeStr;
    }
    public String  getTypeStr2(){
        String typeStr2= "";
        if(type==null)return typeStr2;

        switch (type) {
            case 1:
                typeStr2="普通。允许：收藏，加入购车，立即购买";
                break;
            case 2:
                typeStr2="新品。允许：收藏，加入购车，立即购买";
                break;
            case 3:
                typeStr2="特卖。允许：收藏，加入购车，立即购买";
                break;
            case 4:
                typeStr2="全球购。允许：收藏，加入购车，立即购买。";
                break;
            case 5:
                typeStr2="分销。允许：收藏，加入购车，立即购买";
                break;
            case 6:
                typeStr2="爱购币。允许：收藏，立即购买。显示xx爱购币";
                break;
            case 7:
                typeStr2="积分。允许：收藏，立即购买。无此类型";
                break;
            case 8:
                typeStr2="秒杀。允许：收藏，立即购买。显示倒计时";
                break;
            case 9:
                typeStr2="拼团。允许：收藏，立即购买。显示正在拼团的组；显示拼团价格和正常购买价格";
                break;
            case 10:
                typeStr2="达人试用";
                break;
            default:
                break;
        }
        return typeStr2;
    }
    public String  getStatusStr(){
        String statusStr= "";
        if(status==null)return statusStr;

        switch (status) {
            case 0:
                statusStr="已下架。";
                break;
            case 1:
                statusStr="已上架。";
                break;
            case 2:
                statusStr="未开始。";
                break;
            case 3:
                statusStr="已结束。";
                break;
            default:
                break;
        }
        return statusStr;
    }
    public String  getStatusStr2(){
        String statusStr= "";
        if(status==null)return statusStr;

        switch (status) {
            case 0:
                statusStr="已下架，直接显示此状态。（隐藏：购买、收藏、加入购车）";
                break;
            case 1:
                statusStr="已上架。正常销售";
                break;
            case 2:
                statusStr="未开始。针对秒杀商品";
                break;
            case 3:
                statusStr="已结束。针对秒杀商品";
                break;
            default:
                break;
        }
        return statusStr;
    }

}
